﻿Imports System.Data.SqlClient
Imports DTO

Public Class DieuKhoanTTDAO

    Shared Function layDSDieuKhoan() As List(Of DieuKhoanTTDTO)
        Dim dsDK As New List(Of DieuKhoanTTDTO)
        Dim cn As SqlConnection = CKetNoi.Connect
        Dim cmd As New SqlCommand
        cmd.Connection = cn
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "usp_LayDSDieuKhoan"
        cn.Open
        Dim reader As SqlDataReader = cmd.ExecuteReader
        While reader.Read
            Dim dk As New DieuKhoanTTDTO
            dk.MaDieuKhoan = reader("MaDieuKhoan")
            dk.TenDieuKhoan = reader("TenDieuKhoan")
            dsDK.Add(dk)
        End While
        cn.Close()
        Return dsDK
    End Function

End Class
